#include<iostream>
using namespace std;
class A
{
    public:
    A()
    {
        p=this;
    }
    ~A(){cout<<"dddd"<<endl;delete p; cout<<"dddd"<<endl;p=0;}
    private:
    A *p;
};

int f()
{
    A a;
}

int main()
{
    //A a;
    //delete a;

    f();

    cout<<"dddd"<<endl;
}
